/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Logica;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author User
 */
@Embeddable
public class CompitePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id_deportista")
    private String idDeportista;
    @Basic(optional = false)
    @Column(name = "id_competencia")
    private String idCompetencia;

    public CompitePK() {
    }

    public CompitePK(String idDeportista, String idCompetencia) {
        this.idDeportista = idDeportista;
        this.idCompetencia = idCompetencia;
    }

    public String getIdDeportista() {
        return idDeportista;
    }

    public void setIdDeportista(String idDeportista) {
        this.idDeportista = idDeportista;
    }

    public String getIdCompetencia() {
        return idCompetencia;
    }

    public void setIdCompetencia(String idCompetencia) {
        this.idCompetencia = idCompetencia;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDeportista != null ? idDeportista.hashCode() : 0);
        hash += (idCompetencia != null ? idCompetencia.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompitePK)) {
            return false;
        }
        CompitePK other = (CompitePK) object;
        if ((this.idDeportista == null && other.idDeportista != null) || (this.idDeportista != null && !this.idDeportista.equals(other.idDeportista))) {
            return false;
        }
        if ((this.idCompetencia == null && other.idCompetencia != null) || (this.idCompetencia != null && !this.idCompetencia.equals(other.idCompetencia))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Logica.CompitePK[ idDeportista=" + idDeportista + ", idCompetencia=" + idCompetencia + " ]";
    }
    
}
